package com.dataseek.iot.mysql.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dataseek.iot.mysql.entity.Role;
import com.dataseek.iot.mysql.mapper.RoleMapper;
import com.dataseek.iot.mysql.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author cc
 * @since 2021-09-06
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {


    public Role getRoleByCode(String code){
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("role_code", code);
        return this.getOne(wrapper);
    }
}
